#include "readdownlist.h"
#include <QFile>
#include <QMessageBox>
#include <QDebug>
readDownlist::readDownlist(QObject *parent) : QObject(parent)
{

}

readDownlist::readDownlist(QString fileName)
{
    QFile file(fileName);
    if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
        QMessageBox::warning(NULL,tr("ERRO"),tr("Can't open the file!"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
    }
    while (!file.atEnd()) {
        QByteArray line = file.readLine();
        QString str(line);
        str = str.trimmed();
        qDebug()<< str;
        downList.append(str);
    }
}

QStringList readDownlist::readAll()
{
    return downList;
}
